package com.wiscamp.ninechapters.common.rest;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Collection;

/**
 * 分页实体包装类
 *
 * @param <T>
 * @author yifeng
 */
@Data
@EqualsAndHashCode
public class PagedEntity<T> {
    private int pages;

    private int total;

    private String sort;

    private String field;

    private Collection<T> entities;

    public PagedEntity() {
    }

    public PagedEntity(int pages, int total, String sort, String field, Collection<T> entities) {
        this.pages = pages;
        this.total = total;
        this.sort = sort;
        this.field = field;
        this.entities = entities;
    }
}
